package tech.runchen.gz5055.oms.common.utils.jna;

import cn.hutool.core.codec.Base64;
import com.lrinfo.fpcore;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

/**
 * @author zzj
 */
@Component
@Log4j2
public class JnaLibraryUtils {

    static fpcore jc = new fpcore();

    public int matchTemplate(String src, String dst) {
        int threshold = 0;
        int ret = jc.LoadMatcher();
        if (ret == 1) {
            threshold = jc.MatchTemplate(Base64.decode(src), Base64.decode(dst));
            jc.UnLoadMatcher();
        }
        return threshold;
    }

}
